#include "CObject.h"

CObject::CObject()
{
	m_IdImage = -1;

	m_Flip = SpriteEffect::None;
	m_Scale = D3DXVECTOR2(1.0f, 1.0f);
	//m_Draw = true;

	m_Veclocity_vx = 0.0f;
	m_Veclocity_vy = 0.0f;

	m_Vpx = m_Vpy = 0;
	//m_IsJump = false;
	m_CheckCollision = new Collision();
}


CObject::~CObject()
{
	delete m_Gametime;
	m_IdImage = NULL;
}

void CObject::Draw(LPD3DXSPRITE SpriteHandler)
{
	if (m_Status == IDStatus::DIE) return; // neu nhan vat bi chet thi ko ve nua

	if (!m_IsEffect)
		m_Sprite->Draw(SpriteHandler, D3DXVECTOR2(m_Position.x + m_Sprite->getWidth() / 2, m_Position.y + m_Sprite->getHeight() / 2), m_Scale, m_Vpx, m_Vpy);
	else
	{
		m_Explode->Draw(SpriteHandler, D3DXVECTOR2(m_Position.x + m_Sprite->getWidth() / 2, m_Position.y + m_Sprite->getHeight() / 2), m_Vpx, m_Vpy);
	}
}

